---
layout: m1x_soap
title: Credit History
---

<h3><a name="storecredit.history-Module%3ACustomerBalanceAPI"></a>Module: Customer Balance API</h3>


<h4><a name="storecredit.history-Resource%3Aenterprisecustomerbalance"></a>Resource: enterprise_customerbalance</h4>

<h5><a name="storecredit.history-Aliases%3Astorecredit"></a>Aliases: storecredit</h5>

<h5><a name="storecredit.history-Method%3A"></a>Method:</h5>

<ul>
	<li>enterprise_customerbalance.history (SOAP V1)</li>
	<li>enterpriseCustomerbalanceHistory (SOAP V2)</li>
</ul>


<p>Allows you to retrieve the customer store credit history information.</p>

<p><b>Arguments:</b></p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> string </td>
<td> sessionId </td>
<td> Session ID </td>
</tr>
<tr>
<td> string </td>
<td> customerId </td>
<td> Customer ID </td>
</tr>
<tr>
<td> string </td>
<td> websiteId </td>
<td> Website ID (optional) </td>
</tr>
</tbody></table>


<p><b>Return:</b></p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> array </td>
<td> result </td>
<td> Array of enterpriseCustomerbalanceHistoryItemEntity </td>
</tr>
</tbody></table>


<p>The <b>enterpriseCustomerbalanceHistoryItemEntity</b> content is as follows:</p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> string </td>
<td> history_id </td>
<td> History item ID <br class="atl-forced-newline" /> </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> balance_id <br class="atl-forced-newline" /> </td>
<td> Customer balance ID <br class="atl-forced-newline" /> </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> updated_at <br class="atl-forced-newline" /> </td>
<td> Date when the balance was updated </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> action <br class="atl-forced-newline" /> </td>
<td> Code of the reason for balance change <br class="atl-forced-newline" /> </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> balance_amount <br class="atl-forced-newline" /> </td>
<td> Balance amount after changing <br class="atl-forced-newline" /> </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> balance_delta <br class="atl-forced-newline" /> </td>
<td> Balance change amount <br class="atl-forced-newline" /> </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> additional_info <br class="atl-forced-newline" /> </td>
<td> Comment text <br class="atl-forced-newline" /> </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> is_customer_notified <br class="atl-forced-newline" /> </td>
<td> Defines whether the customer is notified </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> customer_id <br class="atl-forced-newline" /> </td>
<td> Balance owner ID <br class="atl-forced-newline" /> </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> website_id <br class="atl-forced-newline" /> </td>
<td> Website ID </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> base_currency_code <br class="atl-forced-newline" /> </td>
<td> Currency code for the customer balance <br class="atl-forced-newline" /> </td>
</tr>
</tbody></table>


<p><b>Faults:</b></p>


<table><tbody>
<tr>
<th> Fault Code </th>
<th> Fault Message </th>
</tr>
<tr>
<td> 100 </td>
<td> Provided data is invalid. </td>
</tr>
<tr>
<td> 102 </td>
<td> No history found with requested parameters. </td>
</tr>
</tbody></table>


<h4><a name="storecredit.history-Examples"></a>Examples</h4>

<h5><a name="storecredit.history-RequestExampleSOAPV1"></a>Request Example SOAP V1</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
$sessionId = $proxy-&gt;login('apiUser', 'apiKey');
$customerId = 4;

$balanceHistory = $proxy-&gt;call($sessionId, 'storecredit.history', array($customerId));</pre>
		</div>
</div></div>

<h5><a name="storecredit.history-RequestExampleSOAPV2"></a>Request Example SOAP V2</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl'); // TODO : change url
$sessionId = $proxy-&gt;login('apiUser', 'apiKey'); // TODO : change login and pwd if necessary

$result = $proxy-&gt;enterpriseCustomerbalanceHistory($sessionId, '4');
var_dump($result);</pre>
		</div>
</div></div>


<h5><a name="storecredit.history-RequestExampleSOAPV2%28WSIComplianceMode%29"></a>Request Example SOAP V2 (WS-I Compliance Mode)</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl'); 

$sessionId = $proxy-&gt;login((object)array('username' =&gt; 'apiUser', 'apiKey' =&gt; 'apiKey')); 
 
$result = $proxy-&gt;enterpriseCustomerbalanceHistory((object)array('sessionId' =&gt; $sessionId-&gt;result, 'customerId' =&gt; '4', 'websiteId' =&gt; '2'));   
var_dump($result-&gt;result);</pre>
		</div>
</div></div>



<h5><a name="storecredit.history-ResponseExampleSOAPV1"></a>Response Example SOAP V1</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: php; gutter: false">array
  0 =&gt;
    array
      'history_id' =&gt; string '2' (length=1)
      'balance_id' =&gt; string '1' (length=1)
      'updated_at' =&gt; string '2012-04-06 13:50:33' (length=19)
      'action' =&gt; string '1' (length=1)
      'balance_amount' =&gt; string '300.0000' (length=8)
      'balance_delta' =&gt; string '-200.0000' (length=9)
      'additional_info' =&gt; string 'By admin: john@example.com. (update balance)' (length=44)
      'is_customer_notified' =&gt; string '0' (length=1)
      'customer_id' =&gt; string '4' (length=1)
      'website_id' =&gt; string '2' (length=1)
      'base_currency_code' =&gt; null
  1 =&gt;
    array
      'history_id' =&gt; string '1' (length=1)
      'balance_id' =&gt; string '1' (length=1)
      'updated_at' =&gt; string '2012-04-06 13:44:58' (length=19)
      'action' =&gt; string '2' (length=1)
      'balance_amount' =&gt; string '500.0000' (length=8)
      'balance_delta' =&gt; string '500.0000' (length=8)
      'additional_info' =&gt; string 'By admin: john@example.com. (new balance)' (length=41)
      'is_customer_notified' =&gt; string '0' (length=1)
      'customer_id' =&gt; string '4' (length=1)
      'website_id' =&gt; string '2' (length=1)
      'base_currency_code' =&gt; null</pre>
		</div>
</div></div>

				    

